<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div {
            position: absolute;
            left: 0;
            top: 0;
            background-color: orange;
            width: 100px;
            height: 100px;
            border-radius: 50%;
        }
        span {
            width: 1px;
            height: 100px;
            background-color: black;
            position: absolute;
            top: 0;
            left: 300px;
        }
    </style>
</head>
<body>
    <div></div>
    <span></span>
    <script>
        var aDiv = document.getElementsByTagName('div')[0];
            aDiv.onclick = function () {
                startMove(this);
            }
        function startMove (obj) {
            clearInterval(obj.timer);
            var speed = 40,a,u = 0.8;
            obj.timer = setInterval(function () {
                a = (300 - obj.offsetLeft) / 8;
                speed = speed + a;
                speed = speed * u;
                if(Math.abs(speed) < 1 && Math.abs(300 - obj.offsetLeft) < 1) {
                    clearInterval(obj.timer);
                }else {
                    obj.style.left = obj.offsetLeft + speed + 'px';
                }
            },30)
        }
    </script>
</body>
</html>